function typing(){
    var full = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    var fullArr = full.split()
    var num = 0
    function random(min,max){
       return Math.floor( Math.random() * (max - min + 1) + min)
    }

    setInterval(function(){
        // 造div
        var divObj = document.createElement('div')
        divObj.style.height = "20px"
        divObj.style.width = "20px"
        divObj.style.position = 'absolute'
        var left = (window.innerWidth || document.documentElement.clientWidth) - parseInt(divObj.style.width)
        var top = (window.innerHeight || document.documentElement.clientHeight) - parseInt(divObj.style.height)
        console.log(divObj.offsetHeight);
        console.log(random(0,top));
        console.log(random(0,left));
        divObj.innerText = full[random(0,25)]
        divObj.style.left = random(0,left) + 'px'
        divObj.style.top = random(0,top) + 'px'


        document.body.appendChild(divObj)
    },500)
    document.body.onkeyup = function(evt){
    var e = evt || window.event
    // 获取并遍历当前网页上所有存在的div
    var divObjs = document.querySelectorAll('div')
    divObjs.forEach(function(item,i){
        // 判断当前按下的键和div里面的内容是否相等,(注意大小写)
        if(e.key.toUpperCase() === item.innerText.toUpperCase()){
            // 删除内容相同的div
            document.body.removeChild(item)
            // 加分项
            num +=1
            var grade = document.querySelector('p span:nth-of-type(2)')
            grade.innerText = num
        }
    })
}
}